import request from '../../config/axios'

// 宽带套餐信息 VO
export interface BroadbandVO {
  id: number // 套餐ID
  packageName: string // 套餐名称
  speed: string // 宽带速率
  price: number // 套餐价格
  validityPeriod: number // 有效期，单位为月
  status: number // 状态（启用或禁用）
}

// 宽带套餐信息 API
export const BroadbandApi = {
  // 查询宽带套餐信息分页
  getBroadbandPage: async (params: any) => {
    return await request.get({ url: `/broadband/page`, params })
  },

  // 查询宽带套餐信息详情
  getBroadband: async (id: number) => {
    return await request.get({ url: `/broadband/get?id=` + id })
  },
  // 获取首页数据
  getHomeData: async () => {
    return await request.get({ url: `/broadband/getHomeData`})
  },

  // 新增宽带套餐信息
  createBroadband: async (data: BroadbandVO) => {
    return await request.post({ url: `/broadband/create`, data })
  },

  // 修改宽带套餐信息
  updateBroadband: async (data: BroadbandVO) => {
    return await request.put({ url: `/broadband/update`, data })
  },

  // 删除宽带套餐信息
  deleteBroadband: async (id: number) => {
    return await request.delete({ url: `/broadband/delete?id=` + id })
  },

  // 导出宽带套餐信息 Excel
  exportBroadband: async (params) => {
    return await request.download({ url: `/broadband/export-excel`, params })
  },
}
